footer.init();
header.init('提现历史');
var pro_load_page = 2,pro_load_flag = true;
app.ajax(
	'/Member/Shop/w_list',
	{
		page :1
	},function(res){
		if(res.code == 200){
			app.tpl($('.cashRecord'),'tpl-cashRecord',res);
		}else{
			layer.msg('网络繁忙，请稍候再试');
		}
	}
);

window.onload = function(){
	$(window).scroll(function(){
		// 当滚动到距底部以上200像素
		var offset = $(".cashRecord").offset();
		var documentHeight = offset.top + $(".cashRecord").height();
		if (documentHeight - $(this).scrollTop() - $(this).height()<100){
			pro_load_flag && loadMore();
		}
	});
}

function loadMore(){
		var listLoadingEmpty = '<div style="height:3rem;line-height:3rem;text-align:center;font-size:1.2rem;" class="no-more">努力加载中~<div>';
   		$('.cashRecord').append(listLoadingEmpty);
		pro_load_flag = false;
		app.ajax(
			'/Member/Shop/w_list',
			{
				page :pro_load_page
			},function(res){
				$('.cashRecord .no-more').remove();
				if(res.code == 200){
					if(res.list.length>0){
						app.tpladd($('.cashRecord'),'tpl-cashRecord',res);
						pro_load_page++;
						pro_load_flag = true;
					}else{						
						var listLoadingEmpty = '<div style="height:3rem;line-height:3rem;text-align:center;font-size:1.2rem;">没有更多数据了~<div>';
						$('.cashRecord').append(listLoadingEmpty);
						pro_load_flag = false;
					}
				}else{
					layer.msg('网络繁忙，请稍候再试');
				}
			}
		);
}
